--
-- PostgreSQL database dump
--

-- Started on 2011-03-22 19:43:05

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 370 (class 2612 OID 16386)
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE PROCEDURAL LANGUAGE plpgsql;


ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;

SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 1573 (class 1259 OID 16522)
-- Dependencies: 6
-- Name: account; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE account (
    student_id integer NOT NULL,
    user_id integer,
    org_id integer,
    password character varying,
    semester character varying,
    school_year character varying
);


ALTER TABLE public.account OWNER TO postgres;

--
-- TOC entry 1557 (class 1259 OID 16396)
-- Dependencies: 6
-- Name: bk_cash_advance_register; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE bk_cash_advance_register (
    entry_no integer NOT NULL,
    org_id integer,
    date character varying,
    rcv_no character varying,
    requesting_officer character varying,
    purpose character varying,
    amount numeric,
    status character varying
);


ALTER TABLE public.bk_cash_advance_register OWNER TO postgres;

--
-- TOC entry 1558 (class 1259 OID 16402)
-- Dependencies: 6
-- Name: bk_cash_receipt_journal; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE bk_cash_receipt_journal (
    bkcrj_id integer NOT NULL,
    org_id integer,
    date character varying,
    particulars character varying,
    assessment numeric,
    fines numeric,
    interest_deposits numeric,
    donation_solicitation numeric,
    date_created character varying,
    uploader character varying,
    status character varying
);


ALTER TABLE public.bk_cash_receipt_journal OWNER TO postgres;

--
-- TOC entry 1559 (class 1259 OID 16408)
-- Dependencies: 6
-- Name: bk_liquidation_register; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE bk_liquidation_register (
    bkl_id integer NOT NULL,
    org_id integer,
    date character varying,
    officer character varying,
    lf_no integer,
    rcv_no integer,
    amount_advanced numeric,
    actual_amount numeric,
    amount_returned numeric,
    date_created character varying,
    uploader character varying,
    status character varying
);


ALTER TABLE public.bk_liquidation_register OWNER TO postgres;

--
-- TOC entry 1574 (class 1259 OID 16528)
-- Dependencies: 6
-- Name: cashbook; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE cashbook (
    cashbook_id integer NOT NULL,
    org_id integer,
    date character varying,
    particulars character varying,
    received numeric,
    disbursed numeric,
    balance numeric,
    uploader character varying,
    date_created character varying
);


ALTER TABLE public.cashbook OWNER TO postgres;

--
-- TOC entry 1560 (class 1259 OID 16426)
-- Dependencies: 6
-- Name: form1; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form1 (
    or_no integer NOT NULL,
    org_id integer,
    fines numeric,
    assessment_fees numeric,
    names character varying,
    date character varying
);


ALTER TABLE public.form1 OWNER TO postgres;

--
-- TOC entry 1561 (class 1259 OID 16432)
-- Dependencies: 6
-- Name: form10; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form10 (
    entry_no integer NOT NULL,
    org_id integer,
    items character varying,
    cost numeric,
    property_no integer,
    source_funding character varying,
    condition character varying,
    date_purchased character varying
);


ALTER TABLE public.form10 OWNER TO postgres;

--
-- TOC entry 1562 (class 1259 OID 16438)
-- Dependencies: 6
-- Name: form2; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form2 (
    promissory_no integer NOT NULL,
    org_id integer,
    date character varying,
    amount numeric,
    name character varying,
    semester character varying,
    school_year character varying,
    due_date character varying,
    course character varying,
    year character varying,
    witness character varying
);


ALTER TABLE public.form2 OWNER TO postgres;

--
-- TOC entry 1563 (class 1259 OID 16444)
-- Dependencies: 6
-- Name: form3; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form3 (
    rca_form_no integer NOT NULL,
    date_requested character varying,
    requesting_officer character varying,
    "position" character varying,
    purpose character varying,
    specific_activity character varying,
    date_activity character varying,
    approved_amount numeric,
    buficom_chair character varying,
    status character varying,
    org_id integer,
    total_amoun_requested numeric
);


ALTER TABLE public.form3 OWNER TO postgres;

--
-- TOC entry 1564 (class 1259 OID 16450)
-- Dependencies: 6
-- Name: form3_1; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form3_1 (
    rca_form_no integer NOT NULL,
    particulars character varying,
    quantity character varying,
    unit_cost numeric
);


ALTER TABLE public.form3_1 OWNER TO postgres;

--
-- TOC entry 1565 (class 1259 OID 16456)
-- Dependencies: 6
-- Name: form3_2; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form3_2 (
    rca_form_no integer,
    cv_no integer NOT NULL,
    amount_disbursed numeric,
    adviser character varying,
    treasurer character varying,
    withdrawn_from character varying
);


ALTER TABLE public.form3_2 OWNER TO postgres;

--
-- TOC entry 1566 (class 1259 OID 16462)
-- Dependencies: 6
-- Name: form4; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form4 (
    liquidation_form_no integer NOT NULL,
    org_id integer,
    name_recepient_ca character varying,
    cv_no integer,
    amount_received numeric,
    total_amount_disbursed numeric,
    amount_returned numeric,
    date_filed character varying,
    date_audited character varying,
    treasurer_name character varying
);


ALTER TABLE public.form4 OWNER TO postgres;

--
-- TOC entry 1567 (class 1259 OID 16468)
-- Dependencies: 6
-- Name: form4_1; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form4_1 (
    or_no integer NOT NULL,
    liquidation_form_no integer,
    date date,
    particulars character varying,
    amount integer
);


ALTER TABLE public.form4_1 OWNER TO postgres;

--
-- TOC entry 1568 (class 1259 OID 16474)
-- Dependencies: 6
-- Name: form5; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form5 (
    entry_no integer NOT NULL,
    org_id integer,
    event character varying,
    date date,
    names character varying,
    "position" character varying
);


ALTER TABLE public.form5 OWNER TO postgres;

--
-- TOC entry 1569 (class 1259 OID 16480)
-- Dependencies: 6
-- Name: form6; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form6 (
    entry_no integer NOT NULL,
    org_id integer,
    type_uniform character varying,
    names character varying,
    date_received character varying
);


ALTER TABLE public.form6 OWNER TO postgres;

--
-- TOC entry 1570 (class 1259 OID 16486)
-- Dependencies: 6
-- Name: form8; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form8 (
    entry_no integer NOT NULL,
    org_id integer,
    date character varying,
    amount numeric,
    venue_work character varying,
    period_work character varying,
    work_done character varying,
    payee character varying,
    supervising_officer character varying
);


ALTER TABLE public.form8 OWNER TO postgres;

--
-- TOC entry 1571 (class 1259 OID 16492)
-- Dependencies: 6
-- Name: form9; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form9 (
    payroll_id integer NOT NULL,
    org_id integer,
    date character varying,
    activity character varying,
    purpose character varying,
    disbursed_by character varying,
    approved_by character varying,
    date_created character varying,
    uploader character varying,
    status character varying
);


ALTER TABLE public.form9 OWNER TO postgres;

--
-- TOC entry 1572 (class 1259 OID 16498)
-- Dependencies: 6
-- Name: form9_sub; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE form9_sub (
    payroll_sub_id integer NOT NULL,
    org_id integer,
    activity character varying,
    payee character varying,
    amount numeric,
    date_received character varying,
    uploader character varying,
    date_created character varying
);


ALTER TABLE public.form9_sub OWNER TO postgres;

--
-- TOC entry 1575 (class 1259 OID 16534)
-- Dependencies: 6
-- Name: organization; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE organization (
    org_id integer NOT NULL,
    org_name character varying
);


ALTER TABLE public.organization OWNER TO postgres;

--
-- TOC entry 1576 (class 1259 OID 16540)
-- Dependencies: 6
-- Name: student_info; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE student_info (
    student_id integer NOT NULL,
    first_name character varying,
    middle_name character varying,
    last_name character varying,
    year_level integer
);


ALTER TABLE public.student_info OWNER TO postgres;

--
-- TOC entry 1577 (class 1259 OID 16546)
-- Dependencies: 6
-- Name: user; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE "user" (
    id_no integer NOT NULL,
    name character varying NOT NULL,
    year_level integer NOT NULL,
    organization character varying NOT NULL,
    "position" character varying NOT NULL,
    from_sy integer NOT NULL,
    to_sy integer NOT NULL,
    semester integer NOT NULL,
    user_id character varying NOT NULL,
    user_password character varying NOT NULL
);


ALTER TABLE public."user" OWNER TO postgres;

--
-- TOC entry 1578 (class 1259 OID 16552)
-- Dependencies: 6
-- Name: user_org; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE user_org (
    id_no integer NOT NULL,
    org_id integer NOT NULL
);


ALTER TABLE public.user_org OWNER TO postgres;

--
-- TOC entry 1579 (class 1259 OID 16555)
-- Dependencies: 6
-- Name: user_roles; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE user_roles (
    user_id integer NOT NULL,
    user_description character varying
);


ALTER TABLE public.user_roles OWNER TO postgres;

--
-- TOC entry 1927 (class 0 OID 16522)
-- Dependencies: 1573
-- Data for Name: account; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY account (student_id, user_id, org_id, password, semester, school_year) FROM stdin;
\.


--
-- TOC entry 1911 (class 0 OID 16396)
-- Dependencies: 1557
-- Data for Name: bk_cash_advance_register; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY bk_cash_advance_register (entry_no, org_id, date, rcv_no, requesting_officer, purpose, amount, status) FROM stdin;
\.


--
-- TOC entry 1912 (class 0 OID 16402)
-- Dependencies: 1558
-- Data for Name: bk_cash_receipt_journal; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY bk_cash_receipt_journal (bkcrj_id, org_id, date, particulars, assessment, fines, interest_deposits, donation_solicitation, date_created, uploader, status) FROM stdin;
\.


--
-- TOC entry 1913 (class 0 OID 16408)
-- Dependencies: 1559
-- Data for Name: bk_liquidation_register; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY bk_liquidation_register (bkl_id, org_id, date, officer, lf_no, rcv_no, amount_advanced, actual_amount, amount_returned, date_created, uploader, status) FROM stdin;
\.


--
-- TOC entry 1928 (class 0 OID 16528)
-- Dependencies: 1574
-- Data for Name: cashbook; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY cashbook (cashbook_id, org_id, date, particulars, received, disbursed, balance, uploader, date_created) FROM stdin;
\.


--
-- TOC entry 1914 (class 0 OID 16426)
-- Dependencies: 1560
-- Data for Name: form1; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form1 (or_no, org_id, fines, assessment_fees, names, date) FROM stdin;
\.


--
-- TOC entry 1915 (class 0 OID 16432)
-- Dependencies: 1561
-- Data for Name: form10; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form10 (entry_no, org_id, items, cost, property_no, source_funding, condition, date_purchased) FROM stdin;
\.


--
-- TOC entry 1916 (class 0 OID 16438)
-- Dependencies: 1562
-- Data for Name: form2; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form2 (promissory_no, org_id, date, amount, name, semester, school_year, due_date, course, year, witness) FROM stdin;
\.


--
-- TOC entry 1917 (class 0 OID 16444)
-- Dependencies: 1563
-- Data for Name: form3; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form3 (rca_form_no, date_requested, requesting_officer, "position", purpose, specific_activity, date_activity, approved_amount, buficom_chair, status, org_id, total_amoun_requested) FROM stdin;
\.


--
-- TOC entry 1918 (class 0 OID 16450)
-- Dependencies: 1564
-- Data for Name: form3_1; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form3_1 (rca_form_no, particulars, quantity, unit_cost) FROM stdin;
\.


--
-- TOC entry 1919 (class 0 OID 16456)
-- Dependencies: 1565
-- Data for Name: form3_2; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form3_2 (rca_form_no, cv_no, amount_disbursed, adviser, treasurer, withdrawn_from) FROM stdin;
\.


--
-- TOC entry 1920 (class 0 OID 16462)
-- Dependencies: 1566
-- Data for Name: form4; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form4 (liquidation_form_no, org_id, name_recepient_ca, cv_no, amount_received, total_amount_disbursed, amount_returned, date_filed, date_audited, treasurer_name) FROM stdin;
\.


--
-- TOC entry 1921 (class 0 OID 16468)
-- Dependencies: 1567
-- Data for Name: form4_1; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form4_1 (or_no, liquidation_form_no, date, particulars, amount) FROM stdin;
\.


--
-- TOC entry 1922 (class 0 OID 16474)
-- Dependencies: 1568
-- Data for Name: form5; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form5 (entry_no, org_id, event, date, names, "position") FROM stdin;
\.


--
-- TOC entry 1923 (class 0 OID 16480)
-- Dependencies: 1569
-- Data for Name: form6; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form6 (entry_no, org_id, type_uniform, names, date_received) FROM stdin;
\.


--
-- TOC entry 1924 (class 0 OID 16486)
-- Dependencies: 1570
-- Data for Name: form8; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form8 (entry_no, org_id, date, amount, venue_work, period_work, work_done, payee, supervising_officer) FROM stdin;
\.


--
-- TOC entry 1925 (class 0 OID 16492)
-- Dependencies: 1571
-- Data for Name: form9; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form9 (payroll_id, org_id, date, activity, purpose, disbursed_by, approved_by, date_created, uploader, status) FROM stdin;
453	435345	sdfgsd	sdfsdf	fsdfasdf	sdfsdaf	sadfasdf	sdfsdf	sfsdf	sdfsdf
11111	1111	vfsdgsdfg	sgsdfgsdf	sdfgsdfg	sfgsdfg	sdfgsdfg	sgfdsfg	sdfgdsfg	sdfgdsfg
111112	11112	vfsdgsdfg	sgsdfgsdf	sdfgsdfg	sfgsdfg	sdfgsdfg	sgfdsfg	sdfgdsfg	sdfgdsfg
\.


--
-- TOC entry 1926 (class 0 OID 16498)
-- Dependencies: 1572
-- Data for Name: form9_sub; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY form9_sub (payroll_sub_id, org_id, activity, payee, amount, date_received, uploader, date_created) FROM stdin;
\.


--
-- TOC entry 1929 (class 0 OID 16534)
-- Dependencies: 1575
-- Data for Name: organization; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY organization (org_id, org_name) FROM stdin;
\.


--
-- TOC entry 1930 (class 0 OID 16540)
-- Dependencies: 1576
-- Data for Name: student_info; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY student_info (student_id, first_name, middle_name, last_name, year_level) FROM stdin;
\.


--
-- TOC entry 1931 (class 0 OID 16546)
-- Dependencies: 1577
-- Data for Name: user; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY "user" (id_no, name, year_level, organization, "position", from_sy, to_sy, semester, user_id, user_password) FROM stdin;
\.


--
-- TOC entry 1932 (class 0 OID 16552)
-- Dependencies: 1578
-- Data for Name: user_org; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY user_org (id_no, org_id) FROM stdin;
\.


--
-- TOC entry 1933 (class 0 OID 16555)
-- Dependencies: 1579
-- Data for Name: user_roles; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY user_roles (user_id, user_description) FROM stdin;
\.


--
-- TOC entry 1858 (class 2606 OID 16562)
-- Dependencies: 1557 1557
-- Name: BKCashAdvanceRegister_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY bk_cash_advance_register
    ADD CONSTRAINT "BKCashAdvanceRegister_pkey" PRIMARY KEY (entry_no);


--
-- TOC entry 1860 (class 2606 OID 16564)
-- Dependencies: 1558 1558
-- Name: BKCashReceiptJournal_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY bk_cash_receipt_journal
    ADD CONSTRAINT "BKCashReceiptJournal_pkey" PRIMARY KEY (bkcrj_id);


--
-- TOC entry 1862 (class 2606 OID 16566)
-- Dependencies: 1559 1559
-- Name: BKLiquidationRegister_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY bk_liquidation_register
    ADD CONSTRAINT "BKLiquidationRegister_pkey" PRIMARY KEY (bkl_id);


--
-- TOC entry 1866 (class 2606 OID 16572)
-- Dependencies: 1561 1561
-- Name: Form10_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form10
    ADD CONSTRAINT "Form10_pkey" PRIMARY KEY (entry_no);


--
-- TOC entry 1864 (class 2606 OID 16574)
-- Dependencies: 1560 1560
-- Name: Form1_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form1
    ADD CONSTRAINT "Form1_pkey" PRIMARY KEY (or_no);


--
-- TOC entry 1868 (class 2606 OID 16576)
-- Dependencies: 1562 1562
-- Name: Form2_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form2
    ADD CONSTRAINT "Form2_pkey" PRIMARY KEY (promissory_no);


--
-- TOC entry 1872 (class 2606 OID 16578)
-- Dependencies: 1564 1564
-- Name: Form3_1_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form3_1
    ADD CONSTRAINT "Form3_1_pkey" PRIMARY KEY (rca_form_no);


--
-- TOC entry 1874 (class 2606 OID 16580)
-- Dependencies: 1565 1565
-- Name: Form3_2_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form3_2
    ADD CONSTRAINT "Form3_2_pkey" PRIMARY KEY (cv_no);


--
-- TOC entry 1870 (class 2606 OID 16582)
-- Dependencies: 1563 1563
-- Name: Form3_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form3
    ADD CONSTRAINT "Form3_pkey" PRIMARY KEY (rca_form_no);


--
-- TOC entry 1878 (class 2606 OID 16584)
-- Dependencies: 1567 1567
-- Name: Form4.1_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form4_1
    ADD CONSTRAINT "Form4.1_pkey" PRIMARY KEY (or_no);


--
-- TOC entry 1876 (class 2606 OID 16586)
-- Dependencies: 1566 1566
-- Name: Form4_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form4
    ADD CONSTRAINT "Form4_pkey" PRIMARY KEY (liquidation_form_no);


--
-- TOC entry 1880 (class 2606 OID 16588)
-- Dependencies: 1568 1568
-- Name: Form5_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form5
    ADD CONSTRAINT "Form5_pkey" PRIMARY KEY (entry_no);


--
-- TOC entry 1882 (class 2606 OID 16590)
-- Dependencies: 1569 1569
-- Name: Form6_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form6
    ADD CONSTRAINT "Form6_pkey" PRIMARY KEY (entry_no);


--
-- TOC entry 1884 (class 2606 OID 16592)
-- Dependencies: 1570 1570
-- Name: Form8_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form8
    ADD CONSTRAINT "Form8_pkey" PRIMARY KEY (entry_no);


--
-- TOC entry 1886 (class 2606 OID 16594)
-- Dependencies: 1571 1571
-- Name: Form9_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form9
    ADD CONSTRAINT "Form9_pkey" PRIMARY KEY (payroll_id);


--
-- TOC entry 1888 (class 2606 OID 16596)
-- Dependencies: 1572 1572
-- Name: Form9_sub_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY form9_sub
    ADD CONSTRAINT "Form9_sub_pkey" PRIMARY KEY (payroll_sub_id);


--
-- TOC entry 1894 (class 2606 OID 16598)
-- Dependencies: 1575 1575
-- Name: Organization_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY organization
    ADD CONSTRAINT "Organization_pkey" PRIMARY KEY (org_id);


--
-- TOC entry 1890 (class 2606 OID 16606)
-- Dependencies: 1573 1573
-- Name: account_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY account
    ADD CONSTRAINT account_pkey PRIMARY KEY (student_id);


--
-- TOC entry 1892 (class 2606 OID 16608)
-- Dependencies: 1574 1574
-- Name: cashbook_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY cashbook
    ADD CONSTRAINT cashbook_pkey PRIMARY KEY (cashbook_id);


--
-- TOC entry 1896 (class 2606 OID 16610)
-- Dependencies: 1576 1576
-- Name: student_info_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY student_info
    ADD CONSTRAINT student_info_pkey PRIMARY KEY (student_id);


--
-- TOC entry 1900 (class 2606 OID 16612)
-- Dependencies: 1578 1578 1578
-- Name: userOrg_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_org
    ADD CONSTRAINT "userOrg_pkey" PRIMARY KEY (id_no, org_id);


--
-- TOC entry 1898 (class 2606 OID 16614)
-- Dependencies: 1577 1577
-- Name: user_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY "user"
    ADD CONSTRAINT user_pkey PRIMARY KEY (user_id);


--
-- TOC entry 1902 (class 2606 OID 16616)
-- Dependencies: 1579 1579
-- Name: user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY user_roles
    ADD CONSTRAINT user_roles_pkey PRIMARY KEY (user_id);


--
-- TOC entry 1904 (class 2606 OID 16632)
-- Dependencies: 1893 1561 1575
-- Name: Form10_orgId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY form10
    ADD CONSTRAINT "Form10_orgId_fkey" FOREIGN KEY (org_id) REFERENCES organization(org_id);


--
-- TOC entry 1903 (class 2606 OID 16637)
-- Dependencies: 1575 1560 1893
-- Name: Form1_orgId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY form1
    ADD CONSTRAINT "Form1_orgId_fkey" FOREIGN KEY (org_id) REFERENCES organization(org_id);


--
-- TOC entry 1905 (class 2606 OID 16642)
-- Dependencies: 1869 1563 1564
-- Name: Form3_1_rcaFormNo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY form3_1
    ADD CONSTRAINT "Form3_1_rcaFormNo_fkey" FOREIGN KEY (rca_form_no) REFERENCES form3(rca_form_no);


--
-- TOC entry 1906 (class 2606 OID 16647)
-- Dependencies: 1869 1563 1565
-- Name: Form3_2_rcaFormNo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY form3_2
    ADD CONSTRAINT "Form3_2_rcaFormNo_fkey" FOREIGN KEY (rca_form_no) REFERENCES form3(rca_form_no);


--
-- TOC entry 1908 (class 2606 OID 16652)
-- Dependencies: 1566 1875 1567
-- Name: Form4.1_liquidationFormNo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY form4_1
    ADD CONSTRAINT "Form4.1_liquidationFormNo_fkey" FOREIGN KEY (liquidation_form_no) REFERENCES form4(liquidation_form_no);


--
-- TOC entry 1907 (class 2606 OID 16657)
-- Dependencies: 1566 1575 1893
-- Name: Form4_orgId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY form4
    ADD CONSTRAINT "Form4_orgId_fkey" FOREIGN KEY (org_id) REFERENCES organization(org_id);


--
-- TOC entry 1909 (class 2606 OID 16662)
-- Dependencies: 1893 1568 1575
-- Name: Form5_orgId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY form5
    ADD CONSTRAINT "Form5_orgId_fkey" FOREIGN KEY (org_id) REFERENCES organization(org_id);


--
-- TOC entry 1910 (class 2606 OID 16667)
-- Dependencies: 1575 1569 1893
-- Name: Form6_orgId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY form6
    ADD CONSTRAINT "Form6_orgId_fkey" FOREIGN KEY (org_id) REFERENCES organization(org_id);


--
-- TOC entry 1938 (class 0 OID 0)
-- Dependencies: 6
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


-- Completed on 2011-03-22 19:43:06

--
-- PostgreSQL database dump complete
--

